package com.ccl.iot.device;

import com.ccl.iot.IOTAuthMonitor;
import com.ccl.iot.IOTInterface;
import com.ccl.iot.IOTOnlineMonitor;

public class IOTOnlineAuthObject extends IOTOnlineMonitor implements IOTInterface.IOTAuthMonitorInterface {
	private IOTAuthMonitor iAuthMonitor = new IOTAuthMonitor(null);
	
	@Override
	public boolean isMonitoring(IOTMonitorInterface aMonitor) {
		return super.isMonitoring(aMonitor) || iAuthMonitor.isMonitoring(iAuthMonitor);
	}

	@Override
	public int getMonitorListenerCount(IOTMonitorInterface aMonitor) {
		return super.getMonitorListenerCount(aMonitor) + iAuthMonitor.getMonitorListenerCount(iAuthMonitor);
	}

	@Override
	public boolean addAuthChangeListener(IOTAuthChangeListener aListener) {
		return iAuthMonitor.addAuthChangeListener(aListener);
	}

	@Override
	public boolean removeAuthChangeListener(IOTAuthChangeListener aListener) {
		return iAuthMonitor.removeAuthChangeListener(aListener);
	}
	
	protected void onAuthStateChange(int aNewState){
		iAuthMonitor.onAuthStateChange(aNewState);
	}
}
